﻿#include "mythread.h"

MyThread::MyThread(QObject *parent)
{

}

void MyThread::myThreadSlot(const int)
{
    qDebug()<<"myThreadSlot() start to execute";
    qDebug()<<" current thread ID:"<<QThread::currentThreadId()<<'\n';
    int count = 888;
    for(int i = 0;i!=1000000;++i)
    {
        ++count;
    }
}

void MyThread::run()
{

    qDebug()<<"myThread run() start to execute";
    int count = 0;
    myThreadSlot(count);
    emit myThreadSignal(count);
    exec();
}
